<%@ page import="ee.ttu.rakarh.model.data.entities.ItemAttribute" %>
<%@page import="ee.ttu.rakarh.model.data.DataType"%>
<jsp:useBean id="item" scope="request" type="ee.ttu.rakarh.model.data.entities.Item" />

	<div style="white-space:nowrap;">
		<div class="inlineFormBlock" stype="width:200px;">
			<div><div class="param">Name:</div><div class="value"><%= item.getName() %></div></div>
			<div><div class="param">Sale price:</div><div class="value"><%= item.getSalePrice() %></div></div>
			<div><div class="param">Store price:</div><div class="value"><%= item.getStorePrice() %></div></div>
			<div><div class="param">Producer:</div><div class="value"><%= item.getProducer() %></div></div>
			<div><div class="param">Description:</div><div class="value"><%= item.getDescription() %></div></div>
			<div><div class="param">Producer code:</div><div class="value"><%= item.getProducerCode() %></div></div>
			<div><div class="param">Created:</div><div class="value"><%= item.getCreated().toLocaleString() %></div></div>
		</div>
		<div class="inlineFormBlock" stype="width:200px;">
			<div id="form_attributes">
				<% 
				for(ItemAttribute itemAttribute : item.getItemAttributes()){
					out.println("<div><div class=\"param\">");
					
					String value = itemAttribute.getItemAttributeType().getDataType() == DataType.NUMBER ? itemAttribute.getValueNumber().toString() : itemAttribute.getValueText();
					out.println(itemAttribute.getItemAttributeType().getTypeName() + ":");
					out.println("</div><div class=\"value\">");
					out.println(value);
					out.println("</div></div>");
					
				}
				%>
			</div>
		</div>
	</div>
